﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/admin/AdminMaster.master" ValidateRequest="false" CodeFile="LWMakeAdm.aspx.cs" Inherits="admin_LWMakeAdm" %>

<%@ Register Assembly="DotNetTextBox" Namespace="DotNetTextBox" TagPrefix="DNTB" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="AdminRight">
    <div class="rightHeader1">
        <div class="rightHLeft"><span class="rightHeaderTitle">当前位置</span></div>
        <div class="rightHMiddle2">
            <span>
                <a href="Default.aspx" class="moreRight" style="float: left;">首页</a> <span class="jian">></span>
                <a href="LWMakeAdm.aspx" class="moreRight" style="float: left;">论文</a>
            </span>
        </div>
        <div class="rightHRight"></div>
    </div>
    <div style="margin-top: 10px; border: 1px solid #dddddd; width: 766px;">
        <div style="width: 740px; height: auto; overflow: hidden; margin-left: 20px; padding-top: 10px;">
            <div style="float: left;">
                <asp:FormView ID="FormView1" runat="server" AllowPaging="True" BorderWidth="1px" Width="300px"
                    DataKeyNames="lwcid" DataSourceID="SqlDataSource1" DefaultMode="Insert">
                    <FooterStyle BackColor="#1f93e0" ForeColor="#333333" />
                    <RowStyle BackColor="White" ForeColor="#333333" />
                    <EditItemTemplate>
                        lwcid:
            <asp:Label ID="lwcidLabel1" runat="server" Text='<%# Eval("lwcid") %>' />
                        <br />
                        lwcname:
            <asp:TextBox ID="lwcnameTextBox" runat="server" Text='<%# Bind("lwcname") %>' />
                        <br />
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
                            CommandName="Update" Text="更新" />
                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
                            CausesValidation="False" CommandName="Cancel" Text="取消" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        论文类别:
            <asp:TextBox ID="lwcnameTextBox" runat="server" Text='<%# Bind("lwcname") %>' />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                            ControlToValidate="lwcnameTextBox" ErrorMessage="*" ValidationGroup="1"></asp:RequiredFieldValidator>
                        <br />
                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
                            CommandName="Insert" Text="插入" ValidationGroup="1" />
                        &nbsp;<br />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        lwcid:
            <asp:Label ID="lwcidLabel" runat="server" Text='<%# Eval("lwcid") %>' />
                        <br />
                        lwcname:
            <asp:Label ID="lwcnameLabel" runat="server" Text='<%# Bind("lwcname") %>' />
                        <br />
                        <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
                            CommandName="Edit" Text="编辑" />
                        &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False"
                            CommandName="Delete" Text="删除" />
                        &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
                            CommandName="New" Text="新建" />
                    </ItemTemplate>
                    <InsertRowStyle BackColor="#ffffff" />
                    <PagerStyle BackColor="#1f93e0" ForeColor="#FFFFFF" HorizontalAlign="Center" />
                    <HeaderStyle BackColor="#1f93e0" Font-Bold="True" ForeColor="#FFFFFF" />
                    <HeaderTemplate>
                        添加论文类别
                    </HeaderTemplate>
                </asp:FormView>
            </div>
            <div style="float: left; margin-left: 60px;">
                <asp:GridView ID="GridView1" runat="server" Width="300px" GridLines="none" BorderWidth="1px"
                    AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
                    DataKeyNames="lwcid" DataSourceID="SqlDataSource4" PageSize="5"
                    OnRowDeleting="GridView1_RowDeleting">
                    <FooterStyle BackColor="#1f93e0" ForeColor="#333333" />
                    <RowStyle BackColor="White" ForeColor="#333333" />
                    <PagerStyle BackColor="#1f93e0" ForeColor="#FFFFFF" HorizontalAlign="Center" />
                    <Columns>
                        <asp:BoundField DataField="lwcname" HeaderText="论文类别"
                            SortExpression="lwcname" />
                        <asp:TemplateField ShowHeader="False">
                            <EditItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True"
                                    CommandName="Update" Text="更新"></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False"
                                    CommandName="Cancel" Text="取消"></asp:LinkButton>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
                                    CommandName="Edit" Text="编辑"></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False"
                                    CommandName="Delete" OnClientClick="return window.confirm(&quot;确定删除！&quot;);"
                                    Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle BackColor="#1f93e0" Font-Bold="True" ForeColor="#FFFFFF" />
                </asp:GridView>
            </div>
        </div>
        <div style="width: 740px; margin-left: 20px; margin-top: 20px;">
            <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True"
                AutoGenerateRows="False" DataKeyNames="lwid" DataSourceID="SqlDataSource2"
                Height="50px" Width="740px" BackColor="LightGoldenrodYellow" BorderColor="Tan"
                BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black"
                GridLines="Both" OnDataBound="DetailsView1_DataBound">
                <FooterStyle BackColor="Tan" />
                <Fields>
                    <asp:TemplateField HeaderText="标题" SortExpression="lwtitle">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("lwtitle") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                                ControlToValidate="TextBox1" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("lwtitle") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                                ControlToValidate="TextBox1" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("lwtitle") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="lwtime" DataFormatString="{0:d}" HeaderText="时间"
                        SortExpression="lwtime" InsertVisible="False" ReadOnly="True" />
                    <asp:TemplateField HeaderText="类别" SortExpression="lwcname">
                        <EditItemTemplate>
                            <asp:DropDownList ID="DropDownList1" runat="server"
                                DataSourceID="SqlDataSource1" DataTextField="lwcname" DataValueField="lwcid"
                                SelectedValue='<%# Bind("lwcid") %>'>
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:DropDownList ID="DropDownList1" runat="server"
                                DataSourceID="SqlDataSource1" DataTextField="lwcname" DataValueField="lwcid"
                                SelectedValue='<%# Bind("lwcid") %>'>
                            </asp:DropDownList>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("lwcname") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="内容" SortExpression="lwcontent">
                        <EditItemTemplate>
                            <DNTB:WebEditor ID="WebEditor1" runat="server" AdjustSize="50"
                                BackColor="White" BorderColor="#DDDDDD" BorderWidth="0px"
                                CodeBackColor="#E8F4FF" CodeBorder="1px" CodeBorderColor="#6595D6"
                                CodeBorderStyle="Dotted" CodeTitle="以下是代码片段：" EditBorderColor="#CDCDD3"
                                EditHeight="210px" Height="280px" LeftAreaAlign="center" LeftAreaWidth="36%"
                                QuoteBackColor="#E8F4FF" QuoteBorder="1px" QuoteBorderColor="#6595D6"
                                QuoteBorderStyle="Dotted" QuoteTitle="以下是引用片段：" RightAreaAlign="center"
                                RightAreaWidth="64%" Shadow="False" StatusHeight="20px"
                                systemFolder="system_dntb/" Text='<%# Bind("lwcontent") %>'
                                ToolBarColor="#EFEFEF" ToolBarHeight="50px" Width="555px" />
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <DNTB:WebEditor ID="WebEditor1" runat="server" AdjustSize="50"
                                BackColor="White" BorderColor="#DDDDDD" BorderWidth="0px"
                                CodeBackColor="#E8F4FF" CodeBorder="1px" CodeBorderColor="#6595D6"
                                CodeBorderStyle="Dotted" CodeTitle="以下是代码片段：" EditBorderColor="#CDCDD3"
                                EditHeight="210px" Height="280px" LeftAreaAlign="center" LeftAreaWidth="36%"
                                QuoteBackColor="#E8F4FF" QuoteBorder="1px" QuoteBorderColor="#6595D6"
                                QuoteBorderStyle="Dotted" QuoteTitle="以下是引用片段：" RightAreaAlign="center"
                                RightAreaWidth="64%" Shadow="False" StatusHeight="20px"
                                systemFolder="system_dntb/" Text='<%# Bind("lwcontent") %>'
                                ToolBarColor="#EFEFEF" ToolBarHeight="50px" Width="555px" />
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("lwcontent") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField InsertVisible="False" ShowHeader="False">
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                Text="更新"></asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                Text="浏览"></asp:LinkButton>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server"
                                NavigateUrl="~/admin/addLWMakeAdm.aspx">添加</asp:HyperLink>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                Text="编辑"></asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
                                OnClientClick='return window.confirm("确定删除！")' Text="删除"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Fields>
                <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue"
                    HorizontalAlign="Center" />
                <HeaderStyle BackColor="Tan" Font-Bold="True" />
                <EditRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
            </asp:DetailsView>
        </div>
    </div>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server"
        ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:DB_CCXYRCConnectionString %>"
        InsertCommand="INSERT INTO [lwclass] ([lwcname]) VALUES (@lwcname)"
        OldValuesParameterFormatString="original_{0}"
        SelectCommand="SELECT * FROM [lwclass]"
        UpdateCommand="UPDATE [lwclass] SET [lwcname] = @lwcname WHERE [lwcid] = @original_lwcid">

        <UpdateParameters>
            <asp:Parameter Name="lwcname" Type="String" />
            <asp:Parameter Name="original_lwcid" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="lwcname" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server"
        ConnectionString="<%$ ConnectionStrings:DB_CCXYRCConnectionString %>"
        DeleteCommand="DELETE FROM [lwinfo] WHERE [lwid] = @original_lwid AND [lwtitle] = @original_lwtitle AND [lwcontent] = @original_lwcontent AND [lwtime] = @original_lwtime AND [lwcid] = @original_lwcid"
        InsertCommand="INSERT INTO [lwinfo] ([lwtitle], [lwcontent], [lwtime], [lwcid]) VALUES (@lwtitle, @lwcontent, @lwtime, @lwcid)"
        OldValuesParameterFormatString="original_{0}"
        SelectCommand="SELECT * FROM [lwinfo]"
        UpdateCommand="UPDATE [lwinfo] SET [lwtitle] = @lwtitle, [lwcontent] = @lwcontent, [lwtime] = @lwtime, [lwcid] = @lwcid WHERE [lwid] = @original_lwid AND [lwtitle] = @original_lwtitle AND [lwcontent] = @original_lwcontent AND [lwtime] = @original_lwtime AND [lwcid] = @original_lwcid">
        <DeleteParameters>
            <asp:Parameter Name="original_lwid" Type="Int32" />
            <asp:Parameter Name="original_lwtitle" Type="String" />
            <asp:Parameter Name="original_lwcontent" Type="String" />
            <asp:Parameter Name="original_lwtime" Type="DateTime" />
            <asp:Parameter Name="original_lwcid" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="lwtitle" Type="String" />
            <asp:Parameter Name="lwcontent" Type="String" />
            <asp:Parameter Name="lwtime" Type="DateTime" />
            <asp:Parameter Name="lwcid" Type="Int32" />
            <asp:Parameter Name="original_lwid" Type="Int32" />
            <asp:Parameter Name="original_lwtitle" Type="String" />
            <asp:Parameter Name="original_lwcontent" Type="String" />
            <asp:Parameter Name="original_lwtime" Type="DateTime" />
            <asp:Parameter Name="original_lwcid" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="lwtitle" Type="String" />
            <asp:Parameter Name="lwcontent" Type="String" />
            <asp:Parameter Name="lwtime" Type="DateTime" />
            <asp:Parameter Name="lwcid" Type="Int32" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server"
        ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:DB_CCXYRCConnectionString %>"
        DeleteCommand="DELETE FROM [lwinfo] WHERE [lwid] = @original_lwid"
        InsertCommand="INSERT INTO [lwinfo] ([lwtitle], [lwcontent], [lwtime], [lwcid]) VALUES (@lwtitle, @lwcontent,getdate(), @lwcid)"
        OldValuesParameterFormatString="original_{0}"
        SelectCommand="SELECT lwinfo.lwid, lwinfo.lwtitle, lwinfo.lwcontent, lwinfo.lwtime, lwinfo.lwcid, lwclass.lwcname FROM lwinfo INNER JOIN lwclass ON lwinfo.lwcid = lwclass.lwcid"
        UpdateCommand="UPDATE [lwinfo] SET [lwtitle] = @lwtitle, [lwcontent] = @lwcontent,[lwcid] = @lwcid WHERE [lwid] = @original_lwid">
        <DeleteParameters>
            <asp:Parameter Name="original_lwid" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="lwtitle" Type="String" />
            <asp:Parameter Name="lwcontent" Type="String" />
            <asp:Parameter Name="lwcid" Type="Int32" />
            <asp:Parameter Name="original_lwid" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="lwtitle" Type="String" />
            <asp:Parameter Name="lwcontent" Type="String" />
            <asp:Parameter Name="lwcid" Type="Int32" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:DB_CCXYRCConnectionString %>"
        DeleteCommand="DELETE FROM [lwclass] WHERE [lwcid] = @original_lwcid AND [lwcname] = @original_lwcname"
        InsertCommand="INSERT INTO [lwclass] ([lwcname]) VALUES (@lwcname)"
        OldValuesParameterFormatString="original_{0}"
        SelectCommand="SELECT * FROM [lwclass]"
        UpdateCommand="UPDATE [lwclass] SET [lwcname] = @lwcname WHERE [lwcid] = @original_lwcid AND [lwcname] = @original_lwcname">
        <DeleteParameters>
            <asp:Parameter Name="original_lwcid" Type="Int32" />
            <asp:Parameter Name="original_lwcname" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="lwcname" Type="String" />
            <asp:Parameter Name="original_lwcid" Type="Int32" />
            <asp:Parameter Name="original_lwcname" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="lwcname" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
</asp:Content>
